# Contributor: Carlo Bramini <carlo_bramini@users.sourceforge.net>

_realname=liblo
pkgbase=mingw-w64-${_realname}
pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}"
pkgver=0.31
pkgrel=1
pkgdesc="An implementation of the Open Sound Control protocol"
arch=('any')
url="http://liblo.sourceforge.net/"
license=('LGPL2.1')
depends=("${MINGW_PACKAGE_PREFIX}-gcc-libs")
makedepends=("${MINGW_PACKAGE_PREFIX}-gcc"
             "${MINGW_PACKAGE_PREFIX}-pkg-config")
options=('strip' 'staticlibs')
source=("http://downloads.sourceforge.net/${_realname}/${_realname}-${pkgver}.tar.gz")
sha256sums=('2b4f446e1220dcd624ecd8405248b08b7601e9a0d87a0b94730c2907dbccc750')

build() {
  [[ -d "${srcdir}/build-${MINGW_CHOST}" ]] && rm -rf "${srcdir}/build-${MINGW_CHOST}"
  mkdir -p "${srcdir}/build-${MINGW_CHOST}" && cd "${srcdir}/build-${MINGW_CHOST}"

  export lt_cv_deplibs_check_method='pass_all'

  ../${_realname}-${pkgver}/configure \
    --prefix=${MINGW_PREFIX} \
    --build=${MINGW_CHOST} \
    --host=${MINGW_CHOST} \
    --target=${MINGW_CHOST} \
    --enable-shared

  make -j
}

package() {
  cd "${srcdir}/build-${MINGW_CHOST}"
  make DESTDIR="${pkgdir}" install
}
